<template>

      <a-col :span="24">
        <div class="card-title">CS-1剖宫产术前评估</div>
      </a-col>
      <a-col :span="span23.includes(disease.submitName)?24:12" v-for="disease in main1List">


        <a-form-item v-if="disease.useType=='date'" :label="disease.title" :name="disease.submitName">
          <a-date-picker  v-model:value="disease.defaltValue"
                          :format="disease.rule"
                          :valueFormat="disease.rule"
                          :show-time="disease.rule.length>10 "
                          @change="dateInput($event,disease.submitName)"
                          style="width: 100%;"
          />
        </a-form-item>

        <a-form-item v-if="disease.useType=='radio'" :label="disease.title" :name="disease.submitName">
          <a-radio-group v-model:value="disease.defaltValue">
            <a-radio
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
                @change="changeinput($event,disease.submitName)"
            >
              {{ dict.dictName }}
            </a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item v-if="disease.useType=='checkbox'" :label="disease.title" :name="disease.submitName">
          <a-checkbox-group v-model:value="disease.defaultValue"  @change="checkSave($event,disease.submitName)" >
            <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                        v-for="dict in disease.dictList" :key="dict.dictCode">{{
                dict.dictName
              }}</a-checkbox>
          </a-checkbox-group>
        </a-form-item>

        <!--        :placeholder="disease.title"-->
        <a-form-item v-if="disease.useType=='select'" :label="disease.title" :name="disease.submitName">
          <a-select
              v-model:value="disease.defaltValue"
              placeholder="请选择属性类型" allow-clear
               @change="changeSelect($event,disease.submitName)"
          >
            <a-select-option
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
            >
              {{ dict.dictName }}
            </a-select-option>
          </a-select>
        </a-form-item>


        <!--        =========================================特殊处理================================================  -->

        <!--radio-select-->
        <a-form-item v-if="disease.useType=='radio-select-m'&&form1['CS-1-2-1']!=null&&form1['CS-1-2-1'].includes('c')" :label="disease.title" :name="disease.submitName">
          <a-radio-group v-model:value="disease.defaltValue" @change="selectRsm($event,disease.rule,disease.submitName)">
            <a-radio
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
                 @change="changeSelect($event,disease.submitName)"
            >
              {{ dict.dictName }}
            </a-radio>
          </a-radio-group>
        </a-form-item>
        <a-form-item v-if="disease.useType=='select-radio-p'&&( (disease.submitName =='CS-1-1-8'&&form1['CS-1-1-1']=='n')||disease.submitName =='CS-1-2-6'&&form1['CS-1-2-5']=='y')&&form1['CS-1-2-1']!=null&&form1['CS-1-2-1'].includes('c')" :label="disease.title" :name="disease.submitName">
          <a-select
              v-model:value="disease.defaltValue"
              placeholder="请选择属性类型" allow-clear
               @change="changeSelect($event,disease.submitName)"
          >
            <a-select-option
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
            >
              {{ dict.dictName }}
            </a-select-option>
          </a-select>
        </a-form-item>
        <!--end radio-select-->
        <!--select-input-->

        <a-form-item v-if="disease.useType=='select-input-m'" :label="disease.title" :name="disease.submitName">
          <a-select
              v-model:value="disease.defaltValue"
              placeholder="请选择属性类型" allow-clear
               @change="changeSelect($event,disease.submitName)"
          >
            <a-select-option
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
            >
              {{ dict.dictName }}
            </a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item v-if="disease.useType=='input-select-p'&&form1['CS-1-2-4']=='oth'" :label="disease.title" :name="disease.submitName">
          <a-input  v-model:value="disease.defaltValue"  @change="changeinput($event,disease.submitName)"  allow-clear  />
        </a-form-item>
        <!--end select-input-->

    
  </a-col>
      <a-col :span="24">
        <div class="card-title">CS-2 手术指征</div>
      </a-col>
      <a-col :span="span23.includes(disease.submitName)?24:12" v-for="disease in cs2List">
        <a-form-item v-if="disease.useType=='radio'&&disease.submitName=='CS-2-1-1-1'" :label="disease.title" :name="disease.submitName">
          <a-radio-group v-model:value="disease.defaltValue">
            <a-radio
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
                @change="changeCs2($event,disease.submitName)"
            >
              {{ dict.dictName }}
            </a-radio>
          </a-radio-group>
          
        </a-form-item>
        <a-form-item v-if="disease.useType=='select'&&disease.submitName=='CS-2-2-1'&&form1['CS-2-1-1-1']=='n'" :label="disease.title" :name="disease.submitName">
          <a-select
              v-model:value="disease.defaltValue"
              placeholder="请选择属性类型" allow-clear
               @change="changeSelect($event,disease.submitName)"
          >
            <a-select-option
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"

            >
              {{ dict.dictName }}
            </a-select-option>
          </a-select>
          
        </a-form-item>

      </a-col>
     <a-col v-if="form1['CS-2-1-1-1']=='y'">
      <a-col :span="span23.includes(disease.submitName)?24:12" v-for="disease in cs2List">
        <a-form-item v-if="disease.useType=='input'&&form1['CS-2-5-1']!=null&&((disease.submitName=='CS-2-1-1-t'&&form1['CS-2-5-1'].includes('r'))||(disease.submitName=='CS-2-1-1-s'&&form1['CS-2-5-1'].includes('oth')))" :label="disease.title" :name="disease.submitName">
          <a-input  v-model:value="disease.defaltValue"  @change="changeinput($event,disease.submitName)" allow-clear  />
          
        </a-form-item>
        <a-form-item v-if="disease.useType=='checkbox'" :label="disease.title" :name="disease.submitName">
          <a-checkbox-group v-model:value="disease.defaultValue"   @change="checkSave($event,disease.submitName)" >
            <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                        v-for="dict in disease.dictList"
                        :key="dict.dictCode">{{
                dict.dictName
              }}</a-checkbox>
          </a-checkbox-group>
          
        </a-form-item>

        <!--        :placeholder="disease.title"-->
        <a-form-item v-if="disease.useType=='select'&&form1['CS-2-5-1']!=null&&((disease.submitName=='CS-2-1-1-a'&&form1['CS-2-5-1'].includes('a'))
        ||(disease.submitName=='CS-2-1-1-b'&&form1['CS-2-5-1'].includes('b'))||(disease.submitName=='CS-2-1-1-c'&&form1['CS-2-5-1'].includes('c'))
        ||(disease.submitName=='CS-2-1-1-d'&&form1['CS-2-5-1'].includes('d'))||(disease.submitName=='CS-2-1-1-e'&&form1['CS-2-5-1'].includes('e'))
        ||(disease.submitName=='CS-2-1-1-f'&&form1['CS-2-5-1'].includes('f'))||(disease.submitName=='CS-2-1-1-g'&&form1['CS-2-5-1'].includes('g'))
        ||(disease.submitName=='CS-2-1-1-h'&&form1['CS-2-5-1'].includes('h'))||(disease.submitName=='CS-2-1-1-i'&&form1['CS-2-5-1'].includes('i'))
        ||(disease.submitName=='CS-2-1-1-j'&&form1['CS-2-5-1'].includes('j'))||(disease.submitName=='CS-2-1-1-k'&&form1['CS-2-5-1'].includes('k'))
        ||(disease.submitName=='CS-2-1-1-l'&&form1['CS-2-5-1'].includes('l'))||(disease.submitName=='CS-2-1-1-m'&&form1['CS-2-5-1'].includes('m'))
        ||(disease.submitName=='CS-2-1-1-n'&&form1['CS-2-5-1'].includes('n'))||(disease.submitName=='CS-2-1-1-o'&&form1['CS-2-5-1'].includes('o'))
        ||(disease.submitName=='CS-2-1-1-p'&&form1['CS-2-5-1'].includes('p'))||(disease.submitName=='CS-2-1-1-q'&&form1['CS-2-5-1'].includes('q')))" :label="disease.title" :name="disease.submitName">
          <a-select
              v-model:value="disease.defaltValue"
              placeholder="请选择属性类型" allow-clear
               @change="changeSelect($event,disease.submitName)"
          >
            <a-select-option
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"

            >
              {{ dict.dictName }}
            </a-select-option>
          </a-select>
          
        </a-form-item>
      </a-col>
  </a-col>
      <a-col :span="span23.includes(disease.submitName)?24:12" v-for="disease in cs2List">
        <a-form-item v-if="disease.useType=='select'&&disease.submitName=='CS-2-3-1'" :label="disease.title" :name="disease.submitName">
          <a-select
              v-model:value="disease.defaltValue"
              placeholder="请选择属性类型" allow-clear
               @change="changeSelect($event,disease.submitName)"
          >
            <a-select-option
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"

            >
              {{ dict.dictName }}
            </a-select-option>
          </a-select>
          
        </a-form-item>

        <a-form-item v-if="disease.useType=='date'" :label="disease.title" :name="disease.submitName">
          <a-date-picker  v-model:value="disease.defaltValue"
                          :format="disease.rule"
                          :valueFormat="disease.rule"
                          @change="dateInput($event,disease.submitName)"
                          :show-time="disease.rule.length>10 "
                          style="width: 100%;"
          />
          
        </a-form-item>
      </a-col>
    <a-col :span="24">
      <div class="card-title">CS-3 手术前预防性抗菌药物选用一、二代头孢菌素</div>
    </a-col>
  <a-col :span="24">
    <div class="card-page">第一、二产程期间可能发生的感染风险因素：</div>
  </a-col>
  <a-col :span="24" v-for="disease in cs3List">
    <a-form-item v-if="disease.submitName=='CS-3-1-1'" :label="disease.title" :name="disease.submitName">
      <a-select
          v-model:value="disease.defaltValue"
          placeholder="请选择属性类型" allow-clear
           @change="changeSelect($event,disease.submitName)"
      >
        <a-select-option
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
        >
          {{ dict.dictName }}
        </a-select-option>
      </a-select>
      
    </a-form-item>

  </a-col>
  <a-col :span="24">
    <div class="card-page">预防性抗菌药物应用时机：</div>
  </a-col>
  <a-col :span="24" v-for="disease in cs3List">
    <a-form-item v-if="disease.submitName=='CM-1-1-1'" :label="disease.title" :name="disease.submitName">
      <a-radio-group v-model:value="disease.defaltValue" @change="selectRsm($event,disease.rule,disease.submitName)">
        <a-radio
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
        >
          {{ dict.dictName }}
        </a-radio>
      </a-radio-group>
      
    </a-form-item>

  </a-col>
  <a-col :span="24" v-if="form1['CM-1-1-1']=='y'">
      <a-col :span="span23.includes(disease.submitName)?24:12"  v-for="disease in cs3List">
        <a-form-item v-if="disease.useType=='input'&&((disease.submitName=='CM-1-2-2-1'&&form1['CM-1-2-1-2']!=null && form1['CM-1-2-1-2'].includes('g')&&form1['CM-1-2-2-2']!=null && form1['CM-1-2-2-2'].includes('oth'))
        ||(disease.submitName=='CM-1-3-1-1'&&form1['CM-1-3-1-2']!=null&&form1['CM-1-3-1-2'].includes('oth')&&form1['CM-1-2-1-2']!=null&& (form1['CM-1-2-1-2'].includes('g')||form1['CM-1-2-1-2'].includes('oth'))))" :label="disease.title" :name="disease.submitName">
          <a-input  v-model:value="disease.defaltValue"  @change="changeinput($event,disease.submitName)" allow-clear  />
          
        </a-form-item>

        <a-form-item v-if="disease.useType=='date'" :label="disease.title" :name="disease.submitName">
          <a-date-picker  v-model:value="disease.defaltValue"
                          :format="disease.rule"
                          :valueFormat="disease.rule"
                          @change="dateInput($event,disease.submitName)"
                          :show-time="disease.rule.length>10 "
                          style="width: 100%;"
          />
          
        </a-form-item>
        <!--radio-select-->
        <a-form-item v-if="(disease.submitName=='CM-1-2-1-2')||(disease.submitName=='CM-1-2-2-2'&&form1['CM-1-2-1-2']!=null && form1['CM-1-2-1-2'].includes('g'))||(disease.submitName=='CM-1-3-1-2'&& (form1['CM-1-2-1-2'].includes('g')||form1['CM-1-2-1-2'].includes('oth')))" :label="disease.title" :name="disease.submitName">
          <a-checkbox-group v-model:value="disease.defaultValue"    @change="checkSave($event,disease.submitName)"  >
            <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                        v-for="dict in disease.dictList" :key="dict.dictCode">{{
                dict.dictName
              }}</a-checkbox>
          </a-checkbox-group>
          
        </a-form-item>
        <!--end radio-select-->

        <a-form-item v-if="disease.useType=='radio'&&(disease.submitName=='CM-1-5-1'||disease.submitName=='CM-1-5-3'||
        (disease.submitName=='CM-1-5-2'&&form1['CM-1-5-1']=='y')||(disease.submitName=='CM-1-5-4'&&form1['CM-1-5-3']=='y'))" :label="disease.title" :name="disease.submitName">
          <a-radio-group v-model:value="disease.defaltValue">
            <a-radio
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
                @change="changeRadioCs3($event,disease.submitName)"
            >
              {{ dict.dictName }}
            </a-radio>
          </a-radio-group>
          
        </a-form-item>
<!--        <a-form-item v-if="disease.useType=='checkbox'&&disease.submitName!='CM-1-2-1-2'" :label="disease.title" :name="disease.submitName">
          <a-checkbox-group v-model:value="disease.defaltValue"  >
            <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                        @change="checkChange($event,disease.submitName)"
                        v-for="dict in disease.dictList" :key="dict.dictCode">{{
                dict.dictName
              }}</a-checkbox>
          </a-checkbox-group>
        </a-form-item>-->
        <a-form-item v-if="disease.useType=='select'" :label="disease.title" :name="disease.submitName">
          <a-select
              v-model:value="disease.defaltValue"
              placeholder="请选择属性类型" allow-clear
               @change="changeSelect($event,disease.submitName)"
          >
            <a-select-option
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
            >
              {{ dict.dictName }}
            </a-select-option>
          </a-select>
          
        </a-form-item>

      </a-col>
  </a-col>
  <a-col :span="24">
    <div class="card-title">CS-4 新生儿Apgar评分</div>
  </a-col>
  <a-col :span="24">
    <div class="card-page">新生儿出生后1、5、10min,Apgar评分值：</div>
  </a-col>
  <a-col :span="24" v-for="disease in cs4List">
    <a-form-item v-if="disease.submitName=='CS-4-1'" :label="disease.title" :name="disease.submitName">
      <a-radio-group v-model:value="disease.defaltValue">
        <a-radio
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
            @change="changeRadioCs4($event,disease.submitName)"
        >
          {{ dict.dictName }}
        </a-radio>
      </a-radio-group>
      
    </a-form-item>
  </a-col>
  <a-col :span="24" v-if="form1['CS-4-1']=='y'">
  <a-col :span="span23.includes(disease.submitName)?24:12" v-for="disease in cs4List">

    <a-form-item v-if="disease.useType=='number'&&form1['CS-4-2']!=null&&((form1['CS-4-2'].includes('a')&&disease.submitName=='CS-4-3-1')||(form1['CS-4-2'].includes('b')&&disease.submitName=='CS-4-3-2')||(form1['CS-4-2'].includes('c')&&disease.submitName=='CS-4-3-3'))" :label="disease.title" :name="disease.submitName">
      <a-input-number  v-model:value="disease.defaltValue"  @change="numberInput($event,disease.submitName)"  allow-clear  style="width: 100%;"/>
      
    </a-form-item>

    <a-form-item v-if="cs41.includes(disease.submitName)&&disease.useType=='checkbox'&&form1['CS-4-1']=='y'" :label="disease.title" :name="disease.submitName">
      <a-checkbox-group v-model:value="disease.defaultValue"   @change="checkSave($event,disease.submitName)"  >
        <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                    v-for="dict in disease.dictList" :key="dict.dictCode">{{
            dict.dictName
          }}</a-checkbox>
      </a-checkbox-group>
      
    </a-form-item>

  </a-col>
  </a-col>
  <a-col :span="24" v-if="form1['CS-4-1']=='y'">
    <a-col :span="24">
      <div class="card-page">新生儿复苏和出生后15、20min评分值分值：</div>
    </a-col>
    <a-col :span="24" v-for="disease in cs4List">
      <a-form-item v-if="disease.submitName=='CS-4-4-1'" :label="disease.title" :name="disease.submitName">
        <a-radio-group v-model:value="disease.defaltValue">
          <a-radio
              v-for="dict in disease.dictList"
              :key="dict.dictCode"
              :value="dict.dictCode"
              @change="changeRadioCs4($event,disease.submitName)"
          >
            {{ dict.dictName }}
          </a-radio>
        </a-radio-group>
        
      </a-form-item>
    </a-col>
    <a-col :span="24" v-if="form1['CS-4-4-1']=='y'">
      <a-col :span="24" v-for="disease in cs4List">
        <a-form-item v-if="disease.useType=='select'" :label="disease.title" :name="disease.submitName">
          <a-select
              v-model:value="disease.defaltValue"
              placeholder="请选择属性类型" allow-clear
               @change="changeSelect($event,disease.submitName)"
          >
            <a-select-option
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
            >
              {{ dict.dictName }}
            </a-select-option>
          </a-select>
          
        </a-form-item>
        <a-form-item v-if="disease.useType=='number'&&form1['CS-4-4-2']!=null&&((form1['CS-4-4-2'].includes('a')&&disease.submitName=='CS-4-4-2-1')||(form1['CS-4-4-2'].includes('b')&&disease.submitName=='CS-4-4-2-2'))" :label="disease.title" :name="disease.submitName">
          <a-input-number  v-model:value="disease.defaltValue"  @change="numberInput($event,disease.submitName)"  allow-clear  style="width: 100%;"/>
          
        </a-form-item>

        <a-form-item v-if="disease.submitName=='CS-4-4-2'" :label="disease.title" :name="disease.submitName">
          <a-checkbox-group v-model:value="disease.defaultValue"   @change="checkSave($event,disease.submitName)"  >
            <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                        v-for="dict in disease.dictList" :key="dict.dictCode">{{
                dict.dictName
              }}</a-checkbox>
          </a-checkbox-group>
          
        </a-form-item>
        <a-form-item v-if="disease.submitName=='CS-4-5-3'" :label="disease.title" :name="disease.submitName">
          <a-radio-group v-model:value="disease.defaltValue">
            <a-radio
                v-for="dict in disease.dictList"
                :key="dict.dictCode"
                :value="dict.dictCode"
                @change="changeRadioCs4($event,disease.submitName)"
            >
              {{ dict.dictName }}
            </a-radio>
          </a-radio-group>
          
        </a-form-item>
      </a-col>
      <a-col :span="24" v-if="form1['CS-4-5-3']=='y'">
        <a-col :span="24" v-for="disease in cs4List">
          <a-form-item v-if="disease.useType=='date'" :label="disease.title" :name="disease.submitName">
            <a-date-picker  v-model:value="disease.defaltValue"
                            :format="disease.rule"
                            :valueFormat="disease.rule"
                            :show-time="disease.rule.length>10 "
                            @change="dateInput($event,disease.submitName)"
                            style="width: 100%;"
            />
            
          </a-form-item>
          <a-form-item v-if="disease.useType=='number'&&form1['CS-4-5-5']!=null&&((form1['CS-4-5-5'].includes('a')&&disease.submitName=='CS-4-5-5-1')
          ||(form1['CS-4-5-5'].includes('b')&&disease.submitName=='CS-4-5-5-2')
          ||(form1['CS-4-5-5'].includes('c')&&disease.submitName=='CS-4-5-5-3')
          ||(form1['CS-4-5-5'].includes('d')&&disease.submitName=='CS-4-5-5-4'))" :label="disease.title" :name="disease.submitName">
            <a-input-number  v-model:value="disease.defaltValue"  @change="numberInput($event,disease.submitName)"  allow-clear  style="width: 100%;"/>
            
          </a-form-item>

          <a-form-item v-if="disease.submitName=='CS-4-5-5'" :label="disease.title" :name="disease.submitName">
            <a-checkbox-group v-model:value="disease.defaultValue"   @change="checkSave($event,disease.submitName)"  >
              <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                          v-for="dict in disease.dictList" :key="dict.dictCode">{{
                  dict.dictName
                }}</a-checkbox>
            </a-checkbox-group>
            
          </a-form-item>
        </a-col>
      </a-col>
    </a-col>

  </a-col>
  <a-col :span="24">
    <div class="card-title">CS-5 输血量 </div>
  </a-col>
  <a-col :span="24" v-for="disease in cs5List">


    <a-form-item v-if="disease.useType=='radio'" :label="disease.title" :name="disease.submitName">
      <a-radio-group v-model:value="disease.defaltValue" @change="selectRsm($event,disease.rule,disease.submitName)">
        <a-radio
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
        >
          {{ dict.dictName }}
        </a-radio>
      </a-radio-group>
      
    </a-form-item>
    <a-form-item v-if="disease.useType=='input'&&((disease.submitName=='CS-5-1-1'&&form1['CS-5-1']=='a')||(disease.submitName=='CS-5-4'&&form1['CS-5-3']=='a'))" :label="disease.title" :name="disease.submitName">
      <a-input  v-model:value="disease.defaltValue"  @change="changeinput($event,disease.submitName)" allow-clear  />
      
    </a-form-item>
    <a-form-item v-if="disease.useType=='checkbox'" :label="disease.title" :name="disease.submitName">
      <a-checkbox-group v-model:value="disease.defaultValue"   @change="checkSave($event,disease.submitName)"  >
        <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                    v-for="dict in disease.dictList"
                    :key="dict.dictCode">{{
            dict.dictName
          }}</a-checkbox>
      </a-checkbox-group>
      
    </a-form-item>





  </a-col>
  <a-col :span="24">
    <div class="card-title">CS-6 手术并发症与再次手术情况 </div>
  </a-col>
  <a-col :span="24" v-for="disease in cs6List">
    <a-form-item v-if="disease.useType=='radio'" :label="disease.title" :name="disease.submitName">
      <a-radio-group v-model:value="disease.defaltValue">
        <a-radio
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
            @change="changeinput($event,disease.submitName)"
        >
          {{ dict.dictName }}
        </a-radio>
      </a-radio-group>
      
    </a-form-item>
    <a-form-item v-if="disease.useType=='input'&&form1['CS-6-2']=='y'&&form1['CS-6-3']=='oth'" :label="disease.title" :name="disease.submitName">
      <a-input  v-model:value="disease.defaltValue"  @change="changeinput($event,disease.submitName)" allow-clear  />
      
    </a-form-item>
    <a-form-item v-if="disease.useType=='checkbox'&&form1['CS-6-1-1']=='y'" :label="disease.title" :name="disease.submitName">
      <a-checkbox-group v-model:value="disease.defaultValue" @change="checkSave($event,disease.submitName)" >
        <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                    v-for="dict in disease.dictList"
                    :key="dict.dictCode">{{
            dict.dictName
          }}</a-checkbox>
      </a-checkbox-group>
      
    </a-form-item>
    <a-form-item v-if="form1['CS-6-1-1']=='y'&&form1['CS-6-1-3-1']!=null
    &&((form1['CS-6-1-3-1'].includes('a')&&disease.submitName=='CS-6-1-2-1-a')||(form1['CS-6-1-3-1'].includes('b')&&disease.submitName=='CS-6-1-2-1-b')
    ||(form1['CS-6-1-3-1'].includes('c')&&disease.submitName=='CS-6-1-2-1-c')||(form1['CS-6-1-3-1'].includes('d')&&disease.submitName=='CS-6-1-2-1-d')
    ||(form1['CS-6-1-3-1'].includes('e')&&disease.submitName=='CS-6-1-2-1-e')||(form1['CS-6-1-3-1'].includes('f')&&disease.submitName=='CS-6-1-2-1-f')
    ||(form1['CS-6-1-3-1'].includes('g')&&disease.submitName=='CS-6-1-2-1-g')||(form1['CS-6-1-3-1'].includes('h')&&disease.submitName=='CS-6-1-2-1-h'))" :label="disease.title" :name="disease.submitName">
      <a-select
          v-model:value="disease.defaltValue"
          placeholder="请选择属性类型" allow-clear
           @change="changeSelect($event,disease.submitName)"
      >
        <a-select-option
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
        >
          {{ dict.dictName }}
        </a-select-option>
      </a-select>
      
    </a-form-item>
    <a-form-item v-if="disease.submitName=='CS-6-3'&&form1['CS-6-2']=='y'" :label="disease.title" :name="disease.submitName">
      <a-select
          v-model:value="disease.defaltValue"
          placeholder="请选择属性类型" allow-clear
           @change="changeSelect($event,disease.submitName)"
      >
        <a-select-option
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
        >
          {{ dict.dictName }}
        </a-select-option>
      </a-select>
      
    </a-form-item>
  </a-col>
  <a-col :span="24">
    <div class="card-title">CS-7 手术相关新生儿并发症 </div>
  </a-col>
  <a-col :span="span23.includes(disease.submitName)?24:12" v-for="disease in cs7List">


    <a-form-item v-if="disease.useType=='radio'" :label="disease.title" :name="disease.submitName">
      <a-radio-group v-model:value="disease.defaltValue" @change="selectRsm($event,disease.rule,disease.submitName)">
        <a-radio
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
        >
          {{ dict.dictName }}
        </a-radio>
      </a-radio-group>
      
    </a-form-item>
    <a-form-item v-if="disease.useType=='select'&&((form1['CS-7-3']=='y'&&disease.submitName=='CS-7-4')||form1['CS-7-1']=='y'&&(disease.submitName=='CS-7-2'
    ||(disease.submitName=='CS-7-2-a'&&form1['CS-7-2']=='a') ||(disease.submitName=='CS-7-2-b'&&form1['CS-7-2']=='b')
    ||(disease.submitName=='CS-7-2-c'&&form1['CS-7-2']=='c') ||(disease.submitName=='CS-7-2-d'&&form1['CS-7-2']=='d')
    ||(disease.submitName=='CS-7-2-e'&&form1['CS-7-2']=='e')||(disease.submitName=='CS-7-2-f'&&form1['CS-7-2']=='f')
     ||(disease.submitName=='CS-7-2-g'&&form1['CS-7-2']=='g')||(disease.submitName=='CS-7-2-h'&&form1['CS-7-2']=='h')))" :label="disease.title" :name="disease.submitName">
      <a-select
          v-model:value="disease.defaltValue"
          placeholder="请选择属性类型" allow-clear
           @change="changeSelect($event,disease.submitName)"
      >
        <a-select-option
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"

        >
          {{ dict.dictName }}
        </a-select-option>
      </a-select>
      
    </a-form-item>





  </a-col>
  <a-col :span="24">
    <div class="card-title">CS-8 提供母乳喂养教育情况</div>
  </a-col>
  <a-col :span="24" v-for="disease in cs8List">


    <a-form-item v-if="disease.submitName=='CS-8-2-1'||(disease.submitName=='CS-8-2'&&form1['CS-8-2-1']=='n')" :label="disease.title" :name="disease.submitName">
      <a-radio-group v-model:value="disease.defaltValue" @change="changeinput($event,disease.submitName)">
        <a-radio
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
        >
          {{ dict.dictName }}
        </a-radio>
      </a-radio-group>
      
    </a-form-item>
      <a-form-item v-if="disease.useType=='select'&&form1['CS-8-2-1']=='y'" :label="disease.title" :name="disease.submitName">
        <a-select
            v-model:value="disease.defaltValue"
             @change="changeSelect($event,disease.submitName)"
            placeholder="请选择属性类型" allow-clear
        >
          <a-select-option
              v-for="dict in disease.dictList"
              :key="dict.dictCode"
              :value="dict.dictCode"
          >
            {{ dict.dictName }}
          </a-select-option>
        </a-select>
        
      </a-form-item>
      <a-form-item v-if="disease.useType=='input'&&form1['CS-8-2-1']=='y'&&form1['CS-8-1-1']=='oth'" :label="disease.title" :name="disease.submitName">
        <a-input  v-model:value="disease.defaltValue"  @change="changeinput($event,disease.submitName)" allow-clear  />
        
      </a-form-item>
  </a-col>
  <a-col :span="24">
    <div class="card-title">CS-9 住院期间为产妇提供术前、术后健康教育与出院时提供教育告知五要素情况</div>
  </a-col>
  <a-col :span="24">
    <div class="card-page">住院期间为产妇提供术前、术后健康教育：</div>
  </a-col>
  <a-col :span="24" v-for="disease in cs9List">

    <a-form-item v-if="disease.submitName=='CS-9-1-3'" :label="disease.title" :name="disease.submitName">
      <a-radio-group v-model:value="disease.defaltValue" @change="changeinput($event,disease.submitName)">
        <a-radio
            v-for="dict in disease.dictList"
            :key="dict.dictCode"
            :value="dict.dictCode"
        >
          {{ dict.dictName }}
        </a-radio>
      </a-radio-group>
      
    </a-form-item>

    <a-form-item v-if="disease.useType=='input'&&form1['CS-9-1-3']=='y'&&form1['CS-9-1-4']!=null&&form1['CS-9-1-4'].includes('oth')" :label="disease.title" :name="disease.submitName">
      <a-input  v-model:value="disease.defaltValue"  @change="changeinput($event,disease.submitName)" allow-clear  />
      
    </a-form-item>
    <a-form-item v-if="disease.submitName=='CS-9-1-1'||disease.submitName=='CS-9-1-2'||(disease.submitName=='CS-9-1-4'&&form1['CS-9-1-3']=='y')" :label="disease.title" :name="disease.submitName">
      <a-checkbox-group v-model:value="disease.defaultValue"  @change="checkSave($event,disease.submitName)" >
        <a-checkbox :value="dict.dictCode" :name="disease.submitName"
                    v-for="dict in disease.dictList" :key="dict.dictCode">{{
            dict.dictName
          }}</a-checkbox>
      </a-checkbox-group>
      
    </a-form-item>

  </a-col>
  <a-col :span="24">
    <div class="card-page">住院期间为患者提供健康教育：</div>
  </a-col>

</template>

<script setup name="PatientCsForm">
import {ref, reactive, onMounted, watch} from 'vue';
import {message} from "ant-design-vue";

const cs3List = ref([]);
const cs4List = ref([]);
const cs5List = ref([]);
const cs6List = ref([]);
const cs7List = ref([]);
const cs8List = ref([]);
const cs9List = ref([]);
// 剖宫产
const cs2List = ref([]);
const cs2show = ref({
  "CS-2-1-1-a":false,
  "CS-2-1-1-b":false,
  "CS-2-1-1-c":false,
  "CS-2-1-1-d":false,
  "CS-2-1-1-e":false,
  "CS-2-1-1-f":false,
  "CS-2-1-1-g":false,
  "CS-2-1-1-h":false,
  "CS-2-1-1-i":false,
  "CS-2-1-1-j":false,
  "CS-2-1-1-k":false,
  "CS-2-1-1-l":false,
  "CS-2-1-1-m":false,
  "CS-2-1-1-n":false,
  "CS-2-1-1-o":false,
  "CS-2-1-1-p":false,
  "CS-2-1-1-q":false,
  "CS-2-1-1-r":false,
  "CS-2-1-1-oth":false,
  "CS-2-1-1-1":true,
  "CS-2-2-1":false,
  "CS-2-5-1":false,
  "CS-2-3-1":true,
});
const cs3show = ref({
  "CM-1-2-1-2":false,
  "CM-1-2-2-2":false,
  "CM-1-2-2-1":false,
  "CM-1-3-1-1":false,
  "CM-1-3-1-2":false,
});
const cs4show = ref({
  'cs42':false,
});
const main1List = ref([]);
const cs41 = ref([
  "CS-4-1",
  "CS-4-2",
  "CS-4-3-1",
  "CS-4-3-2",
  "CS-4-3-3",
]);
const span23= ref([
    "CS-1-1-9",
  "CS-1-2-1",
  "CS-1-2-7",
  "CS-1-2-2",
  "CS-1-2-31",
  "CM-1-2-1-2",
  "CM-1-2-2-2",
  "CS-2-5-1",
  "CM-1-2-1-2",
  "CS-2-1-1-s",
  "CS-7-2-a",
  "CS-7-2-b",
  "CS-7-2-c",
  "CS-7-2-d",
  "CS-7-2-e",
  "CS-7-2-f",
  "CS-7-2-g",
  "CS-7-2-h",
    "CM-1-3-1-2",
    "CS-4-2",
    "CM-1-2-2-1",
]);
let rsm =  ref({
  "CS-1-1-1": false,
  "CS-1-2-5": false,
  "CM-1-1-1": false,
  "CS-5-1": false,
  "CS-5-3": false,
});
let sim =  ref(false);
/*const props.form1 = ref({});*/
const props = defineProps({
// 表单数据
  diseaseList: Object,
  form1: Object
});
onMounted(async() => {
  console.log(JSON.stringify(props))
});
watch(
    () => props.diseaseList,
() => {
  console.log("---------------------=================================")
    for(let i = 0; i < props.diseaseList.length; i ++) {
     if(props.diseaseList[i].diseaseGroup=="CS-2"){
        cs2List.value.push(props.diseaseList[i])
      }else if(props.diseaseList[i].diseaseGroup=="CS-1"){
        main1List.value.push(props.diseaseList[i])
      } else if(props.diseaseList[i].diseaseGroup=="CS-3"){
        cs3List.value.push(props.diseaseList[i])
      }else if(props.diseaseList[i].diseaseGroup=="CS-4"){
        cs4List.value.push(props.diseaseList[i])
      }else if(props.diseaseList[i].diseaseGroup=="CS-5"){
       cs5List.value.push(props.diseaseList[i])
     } else if(props.diseaseList[i].diseaseGroup=="CS-6"){
       cs6List.value.push(props.diseaseList[i])
     }else if(props.diseaseList[i].diseaseGroup=="CS-7"){
       cs7List.value.push(props.diseaseList[i])
     }else if(props.diseaseList[i].diseaseGroup=="CS-8"){
       cs8List.value.push(props.diseaseList[i])
     }else if(props.diseaseList[i].diseaseGroup=="CS-9"){
       cs9List.value.push(props.diseaseList[i])
     }
    }

}
);

const changeRadioCs4 =  (el,data) => {
  if(data == 'CS-4-1'){
    if(el.target.value == 'y'){
      cs4show.value["CS-4-2"]=true;
      cs4show.value['cs42']=true;
    }else{
      cs4show.value["CS-4-2"]=false;
      cs4show.value['cs42']=false;
    }
  }
  props.form1[data] = el.target.value

}
const changeinput =  (el,data) => {
  props.form1[data] = el.target.value
}
const changeRadioCs3 =  (el,data) => {
  props.form1[data] = el.target.value
}
const checkSave=  (el,data) => {
  props.form1[data] = el
}

const changeCs2 =  (el,data) => {
  props.form1[data] = el.target.value
  if(data == "CS-2-1-1-1"){
    if(el.target.value == "n"){
      cs2show.value ={
        "CS-2-1-1-a":false,
        "CS-2-1-1-b":false,
        "CS-2-1-1-c":false,
        "CS-2-1-1-d":false,
        "CS-2-1-1-e":false,
        "CS-2-1-1-f":false,
        "CS-2-1-1-g":false,
        "CS-2-1-1-h":false,
        "CS-2-1-1-i":false,
        "CS-2-1-1-j":false,
        "CS-2-1-1-k":false,
        "CS-2-1-1-l":false,
        "CS-2-1-1-m":false,
        "CS-2-1-1-n":false,
        "CS-2-1-1-o":false,
        "CS-2-1-1-p":false,
        "CS-2-1-1-q":false,
        "CS-2-1-1-r":false,
        "CS-2-1-1-oth":false,
        "CS-2-1-1-1":true,
        "CS-2-2-1":true,
        "CS-2-3-1":true,
        "CS-2-5-1":false
      };
    }
    if(el.target.value == "y"){
      cs2show.value["CS-2-5-1"]=true;
      cs2show.value["CS-2-2-1"]=false;
    }
  }
}
const changeSelect =  (value,data) => {
  debugger

  if (typeof value === "undefined"){
    props.form1[data] = null
  }else {
    props.form1[data] = value
  }
  if(data ==='CS-1-2-6'&& props.form1[data]!=null){
    message.error("该病例不符合上报要求，请前往HBV 感染分娩母婴阻断进行上报");
    for (let i = 0; i < props.diseaseList.length; i++) {
      if (props.diseaseList[i].submitName == 'CS-1-2-6') {
        props.diseaseList[i].defaltValue = null
        props.form1[data] = null
      }
    }
  }
}
const numberInput =  (el,data) => {
  props.form1[data] = el
}
const dateInput =  (el,data) => {
  props.form1[data] = el
}
const selectRsm = (el,rule,data) => {
  debugger
  props.form1[data] = el.target.value
  if (el.target.value == rule) {
    rsm.value[data] = true;
  } else {
    rsm.value[data] = false;
  }
};

</script>

<style scoped lang="less">
.card-title {
  width: 100%;
  border-left: 5px solid;
  border-color: var(--primary-color);
  color: var(--primary-color);
  font-size: large;
  font-weight: bold;
  padding-left: 10px;
  margin-bottom: 10px;
}
.card-page {
  width: 100%;
  font-weight: bold;
  color: #092b00;
  padding-left: 10px;
  margin-bottom: 10px;
}
.ant-form-item{
  border-bottom:1px solid var(--primary-color);
}
.line {
border-top: 1px solid #b2f1e8; /* 设置横线的样式，比如颜色和宽度 */
margin: 1px 0; /* 设置横线的上下外边距 */
padding-left: -100px!important;
}
</style>
